package com.ciwong.epaper.modules.me.bean;

import android.widget.ScrollView;

import com.ciwong.libs.utils.DateFormat;
import com.ciwong.mobilelib.bean.BaseBean;
import com.ciwong.epaper.bean.SelectObject;

import java.util.List;

/**
 * 我的作业 Created by pla-gysu on 2015/7/29.
 */
public class MyWork extends BaseBean implements SelectObject {
    private static final long serialVersionUID = 8995129117889246902L;
    /**
     * 书籍Id
     */
    private int packageId;
    /**
     * 作业模式：0 练习模式，1为机房模式，2考试模式
     */
    private int examMode;
    /**
     * 查看类型：0 提交立马能查看，1截止时间到后查看
     */
    private int seeWorkMode;
    /**
     * 补交类型：0 截止时间到后能补交 1截止时间到后不能补交
     */
    private int submitMode;

    /**
     * 书籍名称
     */
    public int getShowScoreMode() {
        return showScoreMode;
    }

    /**
     * 显示分数类型：0 截止时间前显示，1截止时间前不显示
     */
    private int showScoreMode;

    /**
     * 是否自动退回模式，1-需要自动退回   0-不需要自动退回
     */
    private int autoRefuseMode;

    /**
     * 自动退回用户设定的分值百分比数字值，前端传值的区间为整数 1- 99
     */
    private int autoRefusePercent;

    public int getAutoRefuseNum() {
        return autoRefuseNum;
    }

    public void setAutoRefuseNum(int autoRefuseNum) {
        this.autoRefuseNum = autoRefuseNum;
    }

    private int autoRefuseNum;
    private String bookName;
    /**
     * 书籍封面
     */

    private String cover;
    /**
     * 学生作业ID
     */
    public String workId = "0";

    /**
     * 做作业ID
     */
    public String doWorkId = "0";

    //作业内容id
    public int contentId;

    /**
     * 作业名称
     */
    private String workName;

    /**
     * 布置人ID
     */
    private int publishUserId;

    /**
     * 布置人姓名
     */
    private String publishUserName;

    /**
     * 作业留言内容
     */
    private String workMessage;

    /**
     * 布置日期
     */
    private long publishDate;
    /**
     * 发送作业的日期，因为有定时发送，所以可能和布置日期不一致。
     */
    public long sendDate;

    /**
     * 服务器时间
     */
    private long nowDate;

    /**
     * 总布置人数
     */
    private int totalNum;

    /**
     * 截止日期
     */
    private long effectiveDate;

    /**
     * 是否删除1:已删除 0:未删除
     */
    private int isDel;

    /**
     * 服务ID
     */
    private int serviceType;

    /**
     * 班级ID
     */
    public String classId;
    /**
     * 科目id
     */
    public int subjectId;
    /**
     * 作业内容表
     */
    private List<WorkContents> workContents;


    public int getPackageId() {
        return packageId;
    }

    public void setPackageId(int packageId) {
        this.packageId = packageId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public long getSendDate() {
        return sendDate;
    }

    public void setSendDate(long sendDate) {
        this.sendDate = sendDate;
    }

    public int getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(int subjectId) {
        this.subjectId = subjectId;
    }

    public void setContentId(int contentId) {
        this.contentId = contentId;
    }

    public int getContentId() {
        return contentId;
    }

    public String getWorkId() {
        return workId;
    }

    public void setWorkId(String workId) {
        this.workId = workId;
    }

    public String getDoWorkId() {
        return doWorkId;
    }

    public void setDoWorkId(String doWorkId) {
        this.doWorkId = doWorkId;
    }

    public String getWorkName() {
        return workName;
    }

    public void setWorkName(String workName) {
        this.workName = workName;
    }

    public int getPublishUserId() {
        return publishUserId;
    }

    public void setPublishUserId(int publishUserId) {
        this.publishUserId = publishUserId;
    }

    public String getPublishUserName() {
        return publishUserName;
    }

    public void setPublishUserName(String publishUserName) {
        this.publishUserName = publishUserName;
    }

    public String getWorkMessage() {
        return workMessage;
    }

    public void setWorkMessage(String workMessage) {
        this.workMessage = workMessage;
    }

    public long getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(long publishDate) {
        this.publishDate = publishDate;
    }

    public int getIsDel() {
        return isDel;
    }

    public void setIsDel(int isDel) {
        this.isDel = isDel;
    }

    public int getServiceType() {
        return serviceType;
    }

    public void setServiceType(int serviceType) {
        this.serviceType = serviceType;
    }

    public List<WorkContents> getWorkContents() {
        return workContents;
    }

    public long getEffectiveDate() {
        return effectiveDate;
    }

    public void setEffectiveDate(long effectiveDate) {
        this.effectiveDate = effectiveDate;
    }


    public int getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(int totalNum) {
        this.totalNum = totalNum;
    }

    public void setClassId(String classId) {
        this.classId = classId;
    }

    public String getClassId() {
        return classId;
    }

    public void setWorkContents(List<WorkContents> workContents) {
        this.workContents = workContents;
    }

    public int getExamMode() {
        return examMode;
    }

    public void setExamMode(int examMode) {
        this.examMode = examMode;
    }

    public int getSeeWorkMode() {
        return seeWorkMode;
    }

    public void setSeeWorkMode(int seeWorkMode) {
        this.seeWorkMode = seeWorkMode;
    }

    public int getSubmitMode() {
        return submitMode;
    }

    public void setSubmitMode(int submitMode) {
        this.submitMode = submitMode;
    }

    public void setShowScoreMode(int showScoreMode) {
        this.showScoreMode = showScoreMode;
    }

    public int getAutoRefuseMode() {
        return autoRefuseMode;
    }

    public void setAutoRefuseMode(int autoRefuseMode) {
        this.autoRefuseMode = autoRefuseMode;
    }

    public int getAutoRefusePercent() {
        return autoRefusePercent;
    }

    public void setAutoRefusePercent(int autoRefusePercent) {
        this.autoRefusePercent = autoRefusePercent;
    }

    public long getNowDate() {
        return nowDate;
    }

    public void setNowDate(long nowDate) {
        this.nowDate = nowDate;
    }

    @Override
    public boolean equals(Object o) {
        return getWorkId().equals(((MyWork) o).getWorkId());
    }

    @Override
    public long getId() {
        long workId = 0;
        try {
            workId = Long.valueOf(getWorkId());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return workId;
    }

    @Override
    public String getName() {
        return DateFormat.getDateString(getPublishDate() * 1000);
    }
}
